<form [formGroup]="loginForm" (ngSubmit)="onSubmit()">
    <div>
        <label>UserName:</label>
        <input formControlName="userName">
    </div>
    <div>
        <label>Password:</label>
        <input formControlName="password" type="password">
    </div>
    <button type="submit">Submit</button>
</form>